package Menus;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;

import FrameWork.Menu;
import Main.SpaceGame;
import World.TileType;

public class DesignationMenu extends Menu
{
	int desStartX = -1, desStartY = -1,desEndX = -1, desEndY = -1;
	TileType type = TileType.Space;
	int pixXPos = SpaceGame.windowXSize-200;
	int pixYPos = 100;
	int width = 200;
	int height = SpaceGame.windowYSize-100;
	int level = 1;
	BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
	boolean cursorRequirement = true;
	public DesignationMenu() 
	{
		
	}

	public void draw(Graphics g)
	{
		g.translate(pixXPos, pixYPos);
		
		g.setColor(Color.LIGHT_GRAY);
		g.fillRect(0, 0, width, height);
		g.setColor(Color.DARK_GRAY);
		g.fillRect(5, 5, width-10, height-10);
		
		List<String> strings = new ArrayList<String>();
		List<Color>  colors= new ArrayList<Color>();
		
		colors.add(checkColor(TileType.Space));
		strings.add("d");
		colors.add(Color.cyan);
		strings.add("- Delete");
		
		colors.add(checkColor(TileType.Interior));
		strings.add("i");
		colors.add(Color.cyan);
		strings.add("- Interior");
		
		colors.add(checkColor(TileType.Hull));
		strings.add("h");
		colors.add(Color.cyan);
		strings.add("- Hull");
		
		printMultiColorLines(g, strings, colors, 2);
		
		g.translate(-pixXPos, -pixYPos);
	}

	@Override
	public int getLevel() 
	{
		return level;
	}
	
	public Color checkColor(TileType type)
	{
		if (this.type == type)
			return Color.green;
		else
			return Color.red;
	}
	
	@Override
	public boolean requiresCursor() 
	{
		return cursorRequirement;
	}

	@Override
	public void setRequiresCursor(boolean f)
	{
		this.cursorRequirement = f;
	}
	
	public TileType getType()
	{
		return type;
	}
	
	public void setType(TileType type)
	{
		this.type = type;
	}
	
	public int[] getDesStartCoords()
	{
		int[] coord = new int[2];
		coord[0] = desStartX;
		coord[1] = desStartY;
		return coord;
	}
	
	public int[] getDesEndCoords()
	{
		int[] coord = new int[2];
		coord[0] = desEndX;
		coord[1] = desEndY;
		return coord;
	}
	
	public void setDesStartCoords(int x, int y)
	{
		this.desStartX = x;
		this.desStartY = y;
	}
	
	public void setDesEndCoords(int x, int y)
	{
		this.desEndX = x;
		this.desEndY = y;
	}
}
